import { ColumnProps } from "/@/components/ProTable/interface";
import { genderType, userLocked } from "/@/utils/serviceDict";

// 配置项
const columns = (renderHeader: any): Partial<ColumnProps>[] => {
    return [{
            type: "selection",
            width: 60,
            fixed: "left"
        },
        {
            type: "index",
            label: "#",
            width: 60
        },
        {
            prop: "name",
            label: "姓名",
            search: true,
            width: 110,
        },
        {
            prop: "gender",
            label: "性别",
            width: "80",
            enum: genderType,
            // search: true,
            sortable: true,
            // searchType: "select"
        },
        {
            prop: "username",
            label: "用户帐号",
            search: true,
            width: 120
        },
        {
            prop: "contact",
            label: "联系电话",
            search: true,
            width: 160
        },
        {
            prop: "idcard",
            label: "身份证号",
            width: 200,
            search: true
        },
        {
            prop: "birthday",
            label: "出生日期",
            width: 100
        },
        {
            prop: "roleNames",
            label: "拥有角色",
            width: 180,
            tag: true,
        },
        {
            prop: "dataStatus",
            label: "帐号状态",
            width: 100,
            tag: true,
            enum: userLocked,
            search: true,
            searchType: "select"
        },
        {
            prop: "createTime",
            label: "创建时间",
            width: 200,
            sortable: true,
            search: true,
            searchType: "datetimerange",
            initSearchParam: ["2022-04-05 00:00:00", "2022-05-10 23:59:59"]
        },
        // {
        // 	prop: "avatar",
        // 	label: "头像",
        // 	width: 120,
        // 	image: true
        // },
        {
            prop: "operation",
            label: "操作",
            width: 220,
            fixed: "right",
            renderHeader
        }
    ]
}

export default columns;